home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '90 / Other Stuff / Demos ƒ / Demo AppMaker / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_103_Window < prev    next >
Encoding:
Text File  |  1990-03-23  |  3.0 KB  |  171 lines

  1. /* %filename% */
  2. /* Created %date% %time% by AppMaker */
  3.  
  4. %If lang = MPW%
  5. #include <Types.h>
  6. #include <Quickdraw.h>
  7. #include <Controls.h>
  8. #include <Dialogs.h>
  9. #include <Events.h>
  10. #include <Lists.h>
  11. #include <Menus.h>
  12. #include <TextEdit.h>
  13.  
  14. %end if%
  15. #include "Globals.h"
  16. #include "ResourceDefs.h"
  17. #include "Scrolling.h"
  18. #include "WindowAids.h"
  19. #include "Miscellany.h"
  20.  
  21. #include "%unitname%.h"
  22.  
  23. %If lang = MPW%
  24. #include <ToolUtils.h>
  25.  
  26. %end if%
  27. #define nil            0L
  28. %If lang = MPW%
  29.  
  30. #pragma segment %unitname% 
  31. %end if%
  32.  
  33. /*----------*/
  34. void Open%WindName% (fName, vRefNum, fRefNum)
  35. Str255        fName;
  36. short        vRefNum;
  37. short        fRefNum;
  38. {
  39.     WindowPtr        newWindow;
  40.     Rect            bounds;
  41.  
  42. %if lang = MPW%
  43. #pragma unused (bounds) 
  44.   
  45. %end if%
  46.     newWindow = GetNewWindow (%WindName%ID, nil, (WindowPtr) -1L);
  47.     SetWTitle (newWindow, fName);
  48.     SetPort (newWindow);
  49.     SetNewInfo (newWindow);
  50.     %if has vScroll%
  51.         cur->vScroll = GetNewControl (%cntlID%, newWindow);
  52.      %else%
  53.         cur->vScroll = nil;
  54.     %end if%
  55.     %if has hScroll%
  56.         cur->hScroll = GetNewControl (%cntlID%, newWindow);
  57.      %else%
  58.         cur->hScroll = nil;
  59.     %end if%
  60.     %for each item gen create%
  61.     %if has editField%
  62.         cur->text = cur->%handlename%;
  63.      %else%
  64.         cur->text = nil;
  65.     %end if%
  66.     cur->fileNum    = fRefNum;
  67.     cur->volNum        = vRefNum;
  68.     cur->dirty        = false;
  69.     cur->filename    = NewString (fName);
  70.     cur->windowKind = W%WindName%;
  71.     ShowWindow (newWindow);
  72. } /*Open%WindName%*/
  73.  
  74. /*----------*/
  75. void Close%WindName% ()
  76. {
  77.     %for each item gen dispose%
  78.     
  79.     DisposHandle ((Handle) cur->filename);
  80.     DiscardInfo (curWindow);
  81. } /*Close%WindName%*/
  82.  
  83. /*----------*/
  84. void MouseIn%WindName% (where, modifiers)
  85. Point        where;
  86. short        modifiers;
  87. {
  88.     Rect            bounds;
  89.  
  90. %if lang = MPW%
  91. #pragma unused (where, modifiers, bounds) 
  92.   
  93. %end if%
  94.     %for each item gen mousein%
  95. } /*MouseIn%WindName%*/
  96.  
  97. /*----------*/
  98. void TypeIn%WindName%   (ch)
  99. char        ch;
  100. {
  101.     if (cur->text == nil) {
  102.         SysBeep (1);
  103.     } else {
  104.         TEKey (ch, cur->text);
  105.     }
  106. } /*TypeIn%WindName%*/
  107.  
  108. /*----------*/
  109. void Update%WindName% ()
  110. {
  111.     Rect            bounds;
  112.  
  113. %if lang = MPW%
  114. #pragma unused (bounds) 
  115.   
  116. %end if%
  117.     %for each item gen update%
  118.     %if has growBox%
  119.         DrawClippedGrow (-15, -15);
  120.     %end if%
  121. } /*Update%WindName%*/
  122.  
  123. /*----------*/
  124. void Activate%WindName% (activate)
  125. Boolean        activate;
  126. {
  127. %if lang = MPW%
  128. #pragma unused (activate) 
  129.   
  130. %end if%
  131.     %for each item gen activate%
  132.     %if has growBox%
  133.         DrawClippedGrow (-15, -15);
  134.     %end if%
  135. } /*Activate%WindName%*/
  136.  
  137. /*----------*/
  138. void Resize%WindName% ()
  139. {
  140.     /* application-specific code to resize items in window */
  141. } /*Resize%WindName%*/
  142.  
  143. /*----------*/
  144. pascal void Scroll%WindName% (newValue, oldValue)
  145. short        newValue;
  146. short        oldValue;
  147. {
  148. %if lang = MPW%
  149. #pragma unused (newValue, oldValue) 
  150.   
  151. %end if%
  152.     /* application-specific code to scroll window */
  153. } /*Scroll%WindName%*/
  154.  
  155. /*----------*/
  156. void Control%WindName%    (whichControl, whichPart, where)
  157. ControlHandle    whichControl;
  158. short             whichPart;
  159. Point            where;
  160. {
  161.     Rect            bounds;
  162.  
  163. %if lang = MPW%
  164. #pragma unused (whichControl, whichPart, where, bounds) 
  165.  
  166. %end if%
  167.     %for each item gen track%
  168. } /*Control%WindName%*/
  169.  
  170. /* %unitname% */
  171.